﻿using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI.WebControls;

namespace SPPatchServiceUI.Admin.SPPatchServiceUI
{
    public partial class AvailablePage : LayoutsPageBase
    {
        protected Label lblFarmVersion;
        protected SPGridView spgvAvailableUpdates;

        public AvailablePage()
        {
            this.PreRender += new EventHandler(this_PreRender);
        }

        private void this_PreRender(object sender, EventArgs e)
        {
            this.lblFarmVersion.Text = Microsoft.SharePoint.Administration.SPFarm.Local.Version.ToString();

            this.spgvAvailableUpdates.DataSource = PatchServiceAPI.GetUpdates();
            this.spgvAvailableUpdates.DataBind();
        }
    }
}
